<?php

function post_to_facebook($title, $link, $message){

		$data = array( 'message' => $message, 'link' => $link, 'description' => $message, 'access_token' => PAGE_ACCESS_TOKEN;

		// init
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/'.PAGE_ID.'/feed');
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		// execute and close
		$return = curl_exec($ch);
		curl_close($ch);
		// end
		return $return;

}

?>